package com.xhtt.modules.cfg.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xhtt.modules.cfg.dao.CfgProductMapper;
import com.xhtt.modules.cfg.entity.CfgProduct;
import com.xhtt.modules.cfg.service.CfgProductService;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author feipc
 * @since 2019-02-18
 */
@Service
public class CfgProductServiceImpl extends ServiceImpl<CfgProductMapper, CfgProduct> implements CfgProductService {

    @Override
    public List<CfgProduct> productList(Map<String, Object> params) {
        Object name = params.get("name");
        Object standId = params.get("standId");
        List<CfgProduct> list = this.list(new LambdaQueryWrapper<CfgProduct>().eq(CfgProduct::getStandId, standId).like(!ObjectUtils.isEmpty(name), CfgProduct::getName, name));
        return list;
    }

}
